﻿using Kz.Telegram.Bot.Console;
using Kz.Telegram.Bot.Infrastructure;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;

var host = Host
    .CreateDefaultBuilder()
    .ConfigureHostConfiguration(config =>
    {

    })
    .ConfigureServices(services =>
    {
        services.AddLogging();
        services.AddHttpContextAccessor();
        services.AddSingleton<Bot>();
    });

var app = host.Build();
ServiceLocator.SetInstance(app.Services);
ServiceLocator.GetRequiredService<Bot>()!.Run();

await app.RunAsync();